package com.yesido.javabase.io.demo3;

import com.yesido.javabase.io.FileConstant;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * @author yesido
 * @description
 * @date 2023-06-28 16:39
 * @Version 8.3
 */
public class FileCopyDemo {
    public static void main(String[] args) {
        Path sourceFilePath = Paths.get(FileConstant.IN_FILE_PATH);
        Path targetFilePath = Paths.get("D:\\TEST\\out.txt");

        try {
            Files.copy(sourceFilePath, targetFilePath);

            System.out.println("文件读写成功！");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
